package foundation.pcmUtil;

import java.awt.*; 
import java.awt.event.*; 

/**
 * 每次解析可靠性的时候，会生成结果页面。此类的方法就是关掉它，避免很多次解析导致eclipse卡死。
 * @author ls
 *
 */
public class ClosePages {

	private Robot robot = null;

	public ClosePages() {
		try {
			robot = new Robot();
		} catch (AWTException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 一般Close All快捷键是Ctrl+SHIFT+F4,若不是，改成它.
	 */
	public void closeCurPages() {
		robot.keyPress(KeyEvent.VK_CONTROL);
		robot.keyPress(KeyEvent.VK_SHIFT);
		robot.keyPress(KeyEvent.VK_F4);

		robot.keyRelease(KeyEvent.VK_F4);
		robot.keyRelease(KeyEvent.VK_SHIFT);
		robot.keyRelease(KeyEvent.VK_CONTROL);
	}
}
